package com.user.repository;

import com.repository.ReadOnlyPagingAndSortingRepository;
import com.user.domain.User;
import org.springframework.data.repository.query.Param;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
import org.springframework.web.bind.annotation.RequestParam;


/**
 * Created by sola on 2017/9/23.
 */
@RepositoryRestResource(collectionResourceRel = "user", path = "user")
public interface UserRepository extends ReadOnlyPagingAndSortingRepository<User,String> {

    User findUserByUserName(@RequestParam("userName") @Param("userName") String userName);

    User getInfoByUserName(@RequestParam(value = "userName",required = false) @Param("userName") String userName);

}
